System Specification
Macua system is composed by the following modules: OpenPlotter/GPS OpenPlotter/anemometer OpenPlotter/Display Autopilot S Autopilot Controller Working mode at start-up is Stand-by. Current Rudder position is obtained from Rudder Feedback function. Target Rudder is evaluated depending on the Working Mode. Actuator Controller function is called to change rudder from Current Rudder to Target Rudder. Working modes Stand-by User commands changes relative to Current Rudder (extension/ retraction of linear actuator). Target Rudder = Current Rudder +/- Delta Rudder. It shall be noticed the leadtime between the moment user commands a change of rudder and the rudder arrival to its target position is not negligible. To prevent unexpected behaviour, commanded changes shall not be buffered. Auto For PID inputs take, Setpoint (SP) = Current Bearing Process Variable (PV) = Target Bearing The difference between two bearings, SP and PV, shall be understood as the minimum angle from SP to PV. if (SP-PV)<=180 then (Error = SP-PV) else (Error = SP-PV-360) Nav TBD Wind TBD PID The Setpoint (SP) is the value that we want the process to be (i.e. target bearing). The PID controller looks at the setpoint and compares it with the actual value of the Process Variable (PV) (i.e. current bearing). Error is the difference between SP and PV. Error is multiplied by all of the calculated P, I and D Control Actions. Then the resulting Error x Control Actions” are added together and sent to the Controller Output. Controller direction is always direct for boat steering process (i.e. bigger Error shall produce bigger Control Action). Gain To configure the PID different parameters are defined, Kp, Ki, Kd are the parameters that drives the P, I and D Control Actions respectivelly. The default are TBC PID method: Proportional On Measurement or Proporcional On Error. Sample Time determines how often the PID algorithm evaluates. The default is 200mS. Deadband Deadband goal is to attenuate fluctuations in PID error signal. Using deadband will increase the service life of the actuator. Error = Setpoint value - Measured value. If abs(Error) < deadband, Error is 0. Is very useful for D-part of PID to avoid extreme output values for small changes (dx/dt) in signal. Trimming Bearing Rate stands for the speed of change of the bearing angle. When tiller is aligned with the center line of the hull, the bearing rate is 0 º/sec. When tiller is displaced, the bearing rate increases accordingly. When the tiller displacement is small, the relationship between bearing rate and tiller angle is linear. As shown in the picture, higher displacement of the tiller will cause higher bearing rates. Above a certain tiller displacement (around 45º), the bearing rate stays still and the resistance of the tiller against water is transformed in decreasing boat speed instead of increasing bearing rate. External forces impacting on the boat may cause a torque moment when tiller is aligned. For instance, the wind impacting on sails or hull, outboard installed on a side of the transom. The goal of trimming function is to detect the bearing rate caused by external forces and compensate by displacing the tiller in the oposite direction. Trimming function, * The function Y=f(X) were Y is the Bearing Rate and X the Tiller Angle around X=0º, can be aproximated to a linear function, and verifies Y= A+BX. * Filter out the values not valid. Changes of the Bearing Rate are slower than changes of tiller. Values of Bearing Rate should be taken 1 second after tiller change. Previous values shall be discarded. * To calculate A and B, ** When tiller<+-10º, take the value of (Tiller Angle, Bearing Rate), where Bearing Rate is (Current Bearing-Previous Bearing)/delta time. ** TBD: Low-pass filtering of bearing might be required ** a linear interpolation of the points is performed, and A and B constants identified. * Identification of the point where the line crosses the X axis. This point verifies Y=0 --> X0=-A/B. * A and B constants are continuosly recalculated, incorporating points to the calculus. Installation Parameters Different parameters that are dependant on the installation shall be defined. Centered Tiller Position: Indicates the linear actuator position when the tiller is aligned with the hull. This is the 0º reference for Trimming function. Maximum rudder angle'':' Limit angle of the rudder. It is used to prevent the linear actuator exceeding the rudder angle and damaging the boat. By default: +/-45º relative to Centered Tiller Position. '''Installation Side: Starboard: Turn to starboard requires extension of the linear actuator from center position. By default. * Linear actuator target position = Controller Output Portboard: Turn to starboard requires retraction of the linear actuator from center position. * Linear actuator target position = - Controller Output Rudder Feedback Linear actuator shall provide a Feedback Signal indicating its position. This feedback is an analog signal provided by a potenciometer integrated into the linear actuator. Actuator parameters Actuator Parameters depends on the specific linear actuator used. The minimum and maximum position is represented by a value of Position Signal between 0 and 1023. Note that minimum may not be represented by 0 and maximum by 1023. * MIN_FEEDBACK: Value of Position Signal in the retracted position (minimum lenght). * MAX_FEEDBACK: Value of Position Signal in the extended position (maximum lenght) To protect linear actuator mechanism from over usage, it is not recomended to arrive to the built-in limits. * LIMIT_FEEDBACK: //Recomended: 10 Position Signal units. To protect linear actuator mechanism from over usage, it is recomended to consider certain error in the Position Signal. * ERROR_FEEDBACK // Recomended: 5 Position Signal units. Actuator potenciometer Position Signal is an analogic signal from a potenciometer integrated into the linear actuator. Actuator Controller Actuator Controller Parameters * DELAY_DIRCHANGE: Protect linear actuator from high throughput due to change of direction. Delay after change of dir in msec. 500 msec recomended. Actuator Controller Functions Linear actuator is driven by a PWM motor controller. 2 signals are required, * SetDirection: Extend or retract. If previousDirection <> currentDirection then Delay (DELAY_DIRCHANGE) * SetSpeed: Stopped or moving (at highest speed) in the direction established by SetDirection. Bearing Monitor